import React, { useEffect } from 'react';
import style from './01.less';

export default function Proto() {
    useEffect(() => {
        let canvas = document.getElementById('canvas');
        let context = canvas.getContext('2d');
        context.font = '48px serif';
        // context.fillStyle = 'cornflowerblue';
        context.strokeStyle = 'blue';
        context.fillText('hello Canvas', canvas.width / 2 - 150, canvas.height / 2 + 15);
        context.strokeText('hello Canvas', canvas.width / 2 - 150, canvas.height / 2 + 15);
    });

    return (
        <canvas id="canvas" className={style.canvas} >
        </canvas>
    );
}